
package framework;

import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;

public class Resultdata {

  public static Map<String, Set<String>> moduleTestCaseMap;
  public static Map<String, Set<String>> testCaseAssertionMap;
  public static Map<String, String> assertionValueMap;

  public static Map<String, Set<String>> getModuleTestCaseMap() {
    if (moduleTestCaseMap == null) {
      moduleTestCaseMap = new LinkedHashMap<String, Set<String>>();
      insertResultToMap("Style Module", "Create Style", "Style creation :ST2536", "passed");
      insertResultToMap("Style Module", "Edit Style", "Edit Style :ST56536", "Failed");
      insertResultToMap("Style Module", "Browse Style", "File Download", "passed");
      insertResultToMap("Style Module", "Browse Style", "Screen Check", "passed");
    }
    return moduleTestCaseMap;
  }

  public static Map<String, Set<String>> getTestCaseAssertionMap() {
    if (testCaseAssertionMap == null) {
      testCaseAssertionMap = new LinkedHashMap<String, Set<String>>();
    }
    return testCaseAssertionMap;
  }

  public static Map<String, String> getAssertionValueMap() {
    if (assertionValueMap == null) {
      assertionValueMap = new LinkedHashMap<String, String>();
    }
    return assertionValueMap;
  }

  public static void insertResultToMap(String moduleName, String testCase, String assertcheck,
      String status) {
    Set<String> testCases = getModuleTestCaseMap().get(moduleName);
    if (testCases == null) {
      testCases = new LinkedHashSet<String>();
      getModuleTestCaseMap().put(moduleName, testCases);
    }
    testCases.add(testCase);

    String key = moduleName + testCase;
    Set<String> set = getTestCaseAssertionMap().get(key);
    if (set == null) {
      set = new LinkedHashSet<String>();
      getTestCaseAssertionMap().put(key, set);
    }
    set.add(assertcheck);

    key = moduleName + testCase + assertcheck;
    getAssertionValueMap().put(key, status);
  }
}
